package com.stox.client.ui.javafx.chartingy.model.shape;

import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import javafx.scene.shape.Circle;

import com.stox.client.ui.javafx.core.util.CSS;
import com.stox.client.ui.javafx.core.util.UI;

public class DeletePoint extends Circle implements EventHandler<MouseEvent> {

	private final Shape shape;

	public DeletePoint(final Shape shape) {
		super(5);
		UI.style(this, CSS.deletePoint);
		this.shape = shape;
		setOnMousePressed(this);
	}

	@Override
	public void handle(final MouseEvent event) {
		shape.getChart().removeShape(shape);
	}

}
